The present invention relates to video coding, and more particularly to block-based video coding such as H.263.
Various applications for digital video communication and storage exist, and corresponding international standards have been and are continuing to be developed. Low bit rate communications, such as, video telephony and conferencing, led to the H.261 standard with bit rates as multiples of 64 kbps. Demand for even lower bit rates resulted in the H.263 standard.
As with other DCT-based video compression standards (H.261, MPEG1, MPEG2, MPEG4), H.263 decomposes a picture into a macroblocks where each macroblock contains four 8×8 luminance blocks plus two 8×8 chrominance blocks. With input 8-bit integer pixel values, conversion to luminance and chrominance pixel values in the range −256 to +255 (i.e., 9 bits).
FIG. 2 depicts the functional blocks of DCT-based video encoding. In order to reduce the bit-rate, 8×8 DCT is used to convert the 8×8 blocks (luminance and chrominance) into the frequency domain; the resulting DCT coefficients will have (rounded to integer) values in the range of −2048 to +2040 (i.e., 12 bits). Then, the 8×8 blocks of DCT-coefficients are quantized, scanned into a 1-D sequence, and coded by using variable length coding (VLC). For predictive coding in which motion compensation (MC) is involved, inverse-quantization and IDCT are needed for the feedback loop. Except for MC, all the function blocks in FIG. 2 operate on an 8×8 block basis. The rate-control unit in FIG. 2 is responsible for producing the quantization scale (qp) in the range 1 to 31 according to the target bit-rate and buffer-fullness to control the DCT-coefficients quantization unit. Indeed, a larger quantization scale implies more vanishing and/or smaller quantized coefficients which means fewer and/or shorter codewords.
There are two kinds of coded macroblocks. An INTRA-coded macroblock is coded independently of previous reference frames. In an INTER-coded macroblock, the motion compensated prediction block from the previous reference frame is first generated for each block (of the current macroblock), then the prediction error block (i.e. the difference block between current block and the prediction block) are encoded.
For INTRA-coded macroblocks, the first (0,0) coefficient in an INTRA-coded 8×8 DCT block is called the DC coefficient, the rest of 63 DCT-coefficients in the block are AC coefficients; while for INTER-coded macroblocks, all 64 DCT-coefficients of an INTER-coded 8×8 DCT block are treated as AC coefficients. The DC coefficients are quantized with a fixed value of the quantization parameter: qp=8, whereas the AC coefficients have quantization parameter levels adjusted according to the bit rate control which compares bit used so far in the encoding of a picture to the allocated number of bits to be used.
The process of H.263 quantization and inverse-quantization for AC coefficients is as in the following steps (pseudocode).
  qp = quantization scale determined by rate control, andconstrained to the range [1:31];  Q = qp+qp;  if ((qp&0x1)==0) delta_q = qp−1;// for qp even  else delta_q = qp;// for qp oddwhere Q is the distance between quantization levels, and delta_q will be used to center an inverse quantization value in its quantization interval. This step is called once for each macroblock. Next,
sign= level <0;// level is the DCT coefficientlevel_q= abs(level);level_q= level_q/Q;// the quantization: integer divideif (level_q > 127) level_q = 127;  // clippingH.263 DCT quantization operates on each AC coefficient of a macroblock. “level” is a not-yet-quantized AC coefficient, and “level_q” is the quantized AC coefficient which is clipped to the range [−127:127]. “sign” is non-zero for negative AC coefficients.
Then the inverse quantization:
level_iq = Q*level_q;level_iq += delta_q;    // center in quantization intervalif (sign) level_iq = −level_iq;if (level_iq <−2048) level_iq = −2048;if (level_iq >2047) level_iq = 2047;H.263 DCT inverse-quantization operates on each non-zero quantized AC coefficient of a macroblock. “level_iq” is the inverse quantization of “level_q” and clipped to the range [−2048:2047].
However, H.263 has a problem of blockiness for various types of video input.